﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DeepZoomPivotConstructor;
using System.Drawing;
using DeepZoomPivotConstructor.VisualLib.Hotspots;
using DeepZoomPivotConstructor.VisualLib;

namespace t_VisualLib
{
    /// <summary>
    /// Summary description for t_VisualHSCenterThere
    /// </summary>
    [TestClass]
    public class t_HSActionCenterThere
    {
        public t_HSActionCenterThere()
        {
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void TestCreation()
        {
            HSActionCenterThere there = new HSActionCenterThere(null);
            Assert.IsFalse(there.LeftClickToActivate, "No clicking by default!");
            Assert.AreEqual(HotSpotActionBase.ActivationKeys.NoKeys, there.KeysToActivate, "No keys shoudl be activating this guy!");
        }

        [TestMethod]
        public void TestLinkOutput()
        {
            VisualBitmapImage bm = new VisualBitmapImage(10.0, 20.0, 10, Color.Red);
            HSActionCenterThere there = new HSActionCenterThere(bm);

            Assert.AreEqual(there.LinkType, "center", "Returned the wrong type");
            Assert.AreEqual("0,0,10,20", there.LinkData, "Link data is incorrect");

            bm.Scale(0.5);
            Assert.AreEqual("0,0,5,10", there.LinkData, "Link data is incorrect after scaling");
        }
    }
}
